Skip to content

Add utility to load JSON sidecar metadata#54

Merged
clane9 merged 1 commit into
mainfrom
sidecars
May 29, 2025
Merged

Add utility to load JSON sidecar metadata#54
clane9 merged 1 commit into
mainfrom
sidecars

Conversation

@clane9
Copy link
Copy Markdown
Contributor

@clane9 clane9 commented May 28, 2025

This PR adds back in a utility function from bids2table v0.2 for loading JSON sidecar metadata (with inheritance). The intention is for users needing metadata to use this function on select files, since loading metadata is slow.

@birajstha what do you think? Would this help with your use cases?

Note, copied with some modification from bids2table v0.2
@clane9 clane9 requested a review from kaitj May 28, 2025 13:51
@codecov
Copy link
Copy Markdown

codecov Bot commented May 28, 2025

Codecov Report

Attention: Patch coverage is 92.30769% with 4 lines in your changes missing coverage. Please review.

Project coverage is 95.56%. Comparing base (c605559) to head (708dc3e).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
bids2table/_metadata.py 91.66% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #54      +/-   ##
==========================================
- Coverage   95.98%   95.56%   -0.42%     
==========================================
  Files           6        7       +1     
  Lines         423      474      +51     
==========================================
+ Hits          406      453      +47     
- Misses         17       21       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@kaitj kaitj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely nice to have included - saves some time I think. Do have a couple questions (see inline)

Comment thread bids2table/_metadata.py
Comment thread bids2table/_metadata.py
@birajstha
Copy link
Copy Markdown

birajstha commented May 29, 2025

Thanks @clane9 , yes, that would be great to have.
But, for now the workaround was pretty easy too, having the file path already built out, I did only swap extensions and read in the json metadata.

Copy link
Copy Markdown
Contributor

@kaitj kaitj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm - the inheritance thing is super important and function will make loading the metadata a lot easier.

@clane9 clane9 merged commit d8bb7a2 into main May 29, 2025
3 checks passed
@kaitj kaitj deleted the sidecars branch November 13, 2025 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants